import type { App } from "vue";

import { formatUnixHandler, mts, uts } from "./format-unix";
import { vSlideIn } from "./slide-in";
export * from "./format-unix";

export type CloudDirective = "uts" | "mts" | "unix" | "var" | "ev";

export const setupDirectives = (app: App, excludes: CloudDirective[] = []) => {
	// 自定义格式化 {dateTime: 1679584806228, template: 'YYYY-MM-DD HH:mm:ss', type: 'mts' | 'uts' }
	if (!excludes.includes("unix")) app.directive("unix", formatUnixHandler);
	// 秒级
	if (!excludes.includes("uts")) app.directive("uts", uts);
	// 毫秒级
	if (!excludes.includes("mts")) app.directive("mts", mts);
	app.directive("slide-in", vSlideIn);
};
